package com.wiwf.model.manage.listener;

import javax.annotation.Resource;

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.activiti.engine.impl.el.FixedValue;

import com.wiwf.model.mapper.business.dao.TbTestBusinessMapper;

public class IntegralIncrementListener implements JavaDelegate {
	
	private FixedValue hello;

    @Resource
    private TbTestBusinessMapper testMapper;

    @Override
    public void execute(DelegateExecution execution) {
        System.out.println("流程到达了指定的节点: \n");
        long count = -1;
        if (testMapper != null) {
        	count = testMapper.getCount(new com.gitee.fastmybatis.core.query.Query());
        } else {
            System.err.println("testMapper is not injected properly.");
        }
        System.out.println(execution.getCurrentActivityId());
        System.out.println("count " + count);
        String helloValue = (String) hello.getValue(execution);
        System.out.println("Hello value: " + helloValue);
    }

	public TbTestBusinessMapper getTestMapper() {
		return testMapper;
	}

	public void setTestMapper(TbTestBusinessMapper testMapper) {
		this.testMapper = testMapper;
	}

	public FixedValue getHello() {
		return hello;
	}

	public void setHello(FixedValue hello) {
		this.hello = hello;
	}

}